package main

import (
	"flag"

	{{.importPackages}}
)

type Serve interface {
	Run() error
}

const (
	{{.moduleConst}}

	// add other module
)

var (
    configFile = flag.String("f", "./etc/local/{{.serviceName}}.yaml", "the config file")
    modeType   = flag.String("m", "{{.serviceName}}", "server run mod")
)

func main() {
	flag.Parse()

    var cfg config.Config
	conf.MustLoad(*configFile, &cfg)

    svc, err := svc.NewServiceContext(cfg)
    if err != nil {
        panic(err)
    }

	var srv Serve
    switch *modeType {
    {{.moduleCase}}
    // add other module case
    default:
        panic("请指定正确的服务")
    }

	srv.Run()
}
